package com.zbkj.service.community.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.zbkj.common.model.community.CommunityRecommender;
import com.zbkj.common.request.CommunityRecommenderSearchRequest;
import com.zbkj.common.request.PageParamRequest;
import com.zbkj.service.community.CommunityRecommenderService;
import com.zbkj.service.dao.community.CommunityRecommenderDao;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
* @author keNan
* @description CommunityRecommenderServiceImpl 接口实现
* @date 2025-06-26
*/
@Service
public class CommunityRecommenderServiceImpl extends ServiceImpl<CommunityRecommenderDao, CommunityRecommender> implements CommunityRecommenderService {

    @Resource
    private CommunityRecommenderDao dao;


    /**
    * 列表
    * @param request 请求参数
    * @param pageParamRequest 分页类参数
    * @author keNan
    * @since 2025-06-26
    * @return List<CommunityRecommender>
    */
    @Override
    public List<CommunityRecommender> getList(CommunityRecommenderSearchRequest request, PageParamRequest pageParamRequest) {
        PageHelper.startPage(pageParamRequest.getPage(), pageParamRequest.getLimit());

        //带 CommunityRecommender 类的多条件查询
        LambdaQueryWrapper<CommunityRecommender> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        CommunityRecommender model = new CommunityRecommender();
        BeanUtils.copyProperties(request, model);
        lambdaQueryWrapper.setEntity(model);
        return dao.selectList(lambdaQueryWrapper);
    }

}

